package ClassificationAlgorithm;

import java.io.BufferedWriter;

import Result.ResultClass;
import Result.ResultIdentificationClass;

public class RelRasCoResultClass extends ResultClass {

	public RelRasCoResultClass(ResultIdentificationClass identifier) {
		super(identifier);

	}
	
	public RelRasCoResultClass(String identifier, int fold) {
		super(null);
		this.identifier = identifier;
		this.fold = fold;
	}

	public long durationtime =0;
	public long subspaceSelectionTime =0;
	public long classifierSelectionTime =0;
	
	
	public double startTestAccuracy;
	public double testAccuracy;
	public double trainAccuracy;
	public double testAccuracyStoppingDecreasedTrain;
	
	public double [] classBasedAccuracy; 
	
	public String identifier;
	public int fold;
	
	
	public void report(BufferedWriter fbw)
	{
		try{
            fbw.write("Fold: "+ this.fold);
            fbw.newLine();
            fbw.write("Train Acc: " +this.trainAccuracy);
			fbw.write("  Test Acc: " +this.testAccuracy);
			fbw.write("  TestAccuracyStoppingDecreasedTrain acc: " +this.testAccuracyStoppingDecreasedTrain);
			
			fbw.newLine();
			
			fbw.write("Class based results: ");
			fbw.newLine();
			
			for(double f: this.classBasedAccuracy)
			{
				fbw.write((float)f +" ");	
			}
			fbw.newLine();
			
            fbw.write("  subselectionTime "+this.subspaceSelectionTime);
            fbw.write("  classifierSelectionTime "+this.classifierSelectionTime);
			fbw.write("  duration "+ this.durationtime); 
			
            fbw.newLine();
			
        }catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }
	}
	
}
